﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FazaDemo.BL.AppFacade;
using FazaDemoSolution.BL.Domain.AbstractCore;
using FazaDemo.PL.Mapping;
using FazaDemo.ViewModels;

namespace FazaDemo.WebSiteMvc.Controllers
{
    public class SupplementalController : Controller
    {

        private readonly ISuppInfoReceiver _infoReceiver;

        private readonly IContainerElementMapper<InfoEntity, SuppleViewModel> _mapper;

        public SupplementalController()
        {
            _infoReceiver = new SuppInfoReceiver();
            _mapper = new ContainerElementMapper<InfoEntity, SuppleViewModel>();
        }

        public SupplementalController(ISuppInfoReceiver infoReceiver, IContainerElementMapper<InfoEntity, SuppleViewModel> mapper)
        {
            _infoReceiver = infoReceiver;
            _mapper = mapper;
        }

        // GET: Output
        [HttpGet]
        public ActionResult Output(int id)
        {
            Tuple<string, string> titles = _infoReceiver.GetSuppTitle(id);
            return PartialView(new SuppleOutputViewModel()
            {
                Tittle = titles.Item1, ModelName = titles.Item2 
            });
        }

    }
}